package com.gexiaobao.pigeon.ui.view

import android.annotation.SuppressLint
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.widget.Toast
import androidx.appcompat.widget.AppCompatTextView
import com.gexiaobao.pigeon.R


/**
 * @Author      : hxw
 * @Date        : 2023/10/26 17:27
 * @Describe    :
 */
@SuppressLint("MissingInflatedId")
class CustomToast(context: Context?) : Toast(context) {

    private val mTextView: AppCompatTextView

    init {
        val inflater = LayoutInflater.from(context)
        val view: View = inflater.inflate(R.layout.custom_toast_layout, null)
        mTextView = view.findViewById(R.id.custom_toast_text)
        setView(view)
    }

    fun setText(text: String?) {
        mTextView.text = text
    }

}